<script lang="ts">
  import { uiHelpers } from 'svelte-5-ui-lib'

  import CodeEditor from '$lib/components/EditorComponents/CodeEditor.svelte'
  import DrawerBox from '$lib/components/DrawerBox.svelte'
  import { APIResponse } from '$lib/utils/stores.svelte'

  let uihelpers = uiHelpers()
  // 自动字符串化（响应式更新）
  let rawText = $derived(
    Object.keys($APIResponse).length === 0 ? '' : JSON.stringify($APIResponse, null, 2)
  )
</script>

<CodeEditor bind:rawText {uihelpers} />
<DrawerBox {uihelpers} bind:rawText />
